#include <iostream>
using namespace std;
int main() {
    int n, m;
    cin >> n >> m;
    long long sum = (long long)(n * (n + 1) / 2) * (m * (m + 1) / 2);
    int k = min(n, m);
    long long ans = 0;
    for(int i = 1; i <= k; i++) {
        ans = ans + (long long)(n - i + 1) * (m - i + 1);
    }
    cout << ans << " " << (long long)sum - ans;
    return 0;
}